import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/index"
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import(/* webpackChunkName: "index" */ '../views/index.vue'),
    children:[
      {
        path: '/index',
        redirect:"/index/home"
      },
      {
        path: '/index/home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "home" */ '../views/Index/Home/index.vue'),
      },
      {
        path: '/index/forum',
        name: 'Forum',
        component: () => import(/* webpackChunkName: "forum" */ '../views/Index/Forum/index.vue'),
      },
      {
        path: '/index/baycar',
        name: 'Baycar',
        component: () => import(/* webpackChunkName: "baycar" */ '../views/Index/Baycar/index.vue'),
      },
      {
        path: '/index/place',
        name: 'Place',
        component: () => import(/* webpackChunkName: "Place" */ '../views/Index/Place/index.vue'),
      },
      {
        path: '/index/my',
        name: 'My',
        component: () => import(/* webpackChunkName: "My" */ '../views/Index/My/index.vue'),
      }
    ]
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "detail" */ '../views/Detail/index.vue')
  },
  {
    path: '/children',
    name: 'children',
    component: () => import(/* webpackChunkName: "children" */ '../components/Vanindexbar.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router